<%@ page pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<c:set var="ctx" value="${pageContext.request.contextPath}"></c:set>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <!-- jQuery (Bootstrap 的所有 JavaScript 插件都依赖 jQuery，所以必须放在前边) -->
	<script src="https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js"></script>
 	<jsp:include page="/_include2/_css.jsp"/>
</head>
<script>
        $().ready(function() {
            $("#userInfoForm").validate({
                rules: {
                	storehouse_name: {
                        required: true,
                        minlength: 2
                    },
                    total_content: {
                        required: true,
                        digits:true
                    },
                    residual_content: {
                        required: true,
                        digits:true
                    },
                    create_date: {
                        required: true,
                        dateISO: true
                    },
                    responsible_person:{
                    	required: true,
                    }
                },
                messages: {
                	storehouse_name: {
                        required: "请输入仓库名",
                        minlength: "仓库名必需由两个字母组成"
                    },
                    total_content: {
                        required: "请输入总容量",
                        digits: "必须输入整数"
                    },
                    residual_content: {
                        required: "请输入剩余容量",
                        digits: "必须输入整数"
                    },
                    create_date: "请输入一个正确的日期"
                }
            });
        });
    </script>
    <style>
        .error{
            color:red;
        }
    </style>
<body>
   
    <jsp:include page="/_include2/_menu.jsp">
		<jsp:param value="仓库管理" name="one"/>
		<jsp:param value="仓库列表" name="two"/>
	</jsp:include>
    <div class="col-md-12">
        	<form action="${ctx}/StoreServlet/edit" >
        	<input type="hidden" name="storehouse_id" value="${store.storehouse_id }"/>
        	
			<div class="form-group">
				<div>
				<p>	<label for="storehouse_name">仓库名称</label> </p>
				</div>
				<input type="text" class="form-control" id="storehouse_name" name="storehouse_name" value="${store.storehouse_name}">
			</div>
			
			<div class="form-group">
				<label>创建日期：</label> 
			<input type="text" name="creation_date" class="form-control" value='<fmt:formatDate value="${store.creation_date}" pattern="yyyy-MM-dd"/>'/>
			</div>
			<div class="form-group">
				<label>总容量：</label> 
			<input type="text" name="total_content" class="form-control" value="${store.total_content}"/>
			</div>
			<div class="form-group">
				<label>剩余容量：</label> 
			<input type="text" name="residual_content" class="form-control" value="${store.residual_content}"/>
			</div>
			<div class="form-group">
				<label>备注：</label> 
			<input type="text" name="remark" class="form-control" value="${store.remark}"/>
			</div>
			<div class="form-group">
				<label>仓库负责人：</label> 
				<input type="text" name="responsible_person" class="form-control" value="${store.responsible_person }"/>
			</div>
			<input type="submit" class="btn btn-default" value="修改"/>
		</form>
    </div>
</body>

<!-- 加载 Bootstrap 的所有 JavaScript 插件。你也可以根据需要只加载单个插件。 -->
<script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
	<script src="${pageContext.request.contextPath}/js2/jquery.js"></script>
    <script src="${pageContext.request.contextPath}/js2/jquery.validate.js"></script>
    <script src="${pageContext.request.contextPath}/js2/messages_zh.js"></script>
<script>
	$('select').val('${store.responsible_person }');
	
</script>
</html>